#!/bin/sh

if [ ! $1 ]; then
	echo " You did not provide an image! "
    exit 1
fi

if [ ! -f $1 ]
then
    echo " File $1 does not exists! " 
    exit 1
fi

echo " Very well... I will flash $1 "

echo " flash_eraseall /dev/mtd6 "
flash_eraseall /dev/mtd6
echo " nandwrite -p /dev/mtd6 $1 "
nandwrite -p /dev/mtd6 $1
